import request from '@/utils/request'

// 查询采购发票列表
export function listInvoice(query) {
  return request({
    url: '/cg/invoice/list',
    method: 'get',
    params: query
  })
}

// 查询采购发票详细
export function getInvoice(id) {
  return request({
    url: '/cg/invoice/' + id,
    method: 'get'
  })
}

// 新增采购发票
export function addInvoice(data) {
  return request({
    url: '/cg/invoice',
    method: 'post',
    data: data
  })
}

// 修改采购发票
export function updateInvoice(data) {
  return request({
    url: '/cg/invoice',
    method: 'put',
    data: data
  })
}

// 删除采购发票
export function delInvoice(id) {
  return request({
    url: '/cg/invoice/' + id,
    method: 'delete'
  })
}
// 查询待选单据列表
export function listReceipt(query) {
  return request({
    url: '/cg/invoice/getNotInvoicedRecpt',
    method: 'get',
    params: query
  })
}
//审核采购发票
export function confirmInvoice(id) {
  return request({
    url: '/cg/invoice/confirm/'+id,
    method: 'put'
  })
}
//获取汇率下拉选数据
export function getTaxRateSelectData(query) {
  return request({
    url: '/md/taxRate/getSelectData',
    method: 'get',
    params: query
  })
}
